Skip to contentSkip to conversation

Change in openvpn[master]: Fix incorrect condition for checking password related check

Openvpn-devel In review plaisthos (Code Review) 2 participants 6 messages Mar 23, 2025 – Mar 24, 2025 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1742731599000.I28a8abd0ee3fa9168a716171b0a405476089c4a1@...2715...

#1 lore raw

Attention is currently required from: flichtenheld.

Hello flichtenheld,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/912?usp=email

to review the following change.

Change subject: Fix incorrect condition for checking password related check
......................................................................

Fix incorrect condition for checking password related check

Commit db48cea chagned logic to move logic from a variable and repeated checks to an if clause.

The old code had

            const bool ccnr = (options->auth_user_pass_verify_script
                                || PLUGIN_OPTION_LIST(options)
                                || MAN_CLIENT_AUTH_ENABLED(options));

followed by several condition that checked !ccnr

This commit fixes the if clause by correctly applying De Margan's law.

Change-Id I28a8abd0ee3fa9168a716171b0a405476089c4a1

---
M src/openvpn/options.c

1 file changed, 2 insertions(+), 2 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/12/912/1

src/openvpn/options.c +2 -2
index 67ef55b..ab56609 100644
@@ -2752,8 +2752,8 @@
 
         }
         if (!options->auth_user_pass_verify_script
-            || PLUGIN_OPTION_LIST(options)
-            || MAN_CLIENT_AUTH_ENABLED(options))
+            && !PLUGIN_OPTION_LIST(options)
+            && !MAN_CLIENT_AUTH_ENABLED(options))
         {
             const char *use_err = "--%s must be used with --management-client-auth, an --auth-user-pass-verify script, or plugin";
 

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/912?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I28a8abd0ee3fa9168a716171b0a405476089c4a1
Gerrit-Change-Number: 912
Gerrit-PatchSet: 1
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newchange

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld, plaisthos.

ordex has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/912?usp=email )

Change subject: Fix incorrect condition for checking password related check
......................................................................

Patch Set 1: Code-Review+2

(1 comment)

Patchset:

PS1:
it's De Morgan, not De Margan.
Other than that the fix looks good. Thanks to the extensive commit it is easy to verify the change.

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/912?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I28a8abd0ee3fa9168a716171b0a405476089c4a1
Gerrit-Change-Number: 912
Gerrit-PatchSet: 1
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: ordex <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Sun, 23 Mar 2025 20:40:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

#3 lore raw

PATCH 1/1 Fix incorrect condition for checking password related check

In reply to a message not in the archive

From: Arne Schwabe <[email protected]...>

Commit db48cea chagned logic to move logic from a variable and repeated checks to an if clause.

The old code had

            const bool ccnr = (options->auth_user_pass_verify_script
                                || PLUGIN_OPTION_LIST(options)
                                || MAN_CLIENT_AUTH_ENABLED(options));

followed by several condition that checked !ccnr

This commit fixes the if clause by correctly applying De Margan's law.

Change-Id I28a8abd0ee3fa9168a716171b0a405476089c4a1

---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/912
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
Antonio Quartulli <[email protected]...>

src/openvpn/options.c +2 -2
index 67ef55b..ab56609 100644
@@ -2752,8 +2752,8 @@
 
         }
         if (!options->auth_user_pass_verify_script
-            || PLUGIN_OPTION_LIST(options)
-            || MAN_CLIENT_AUTH_ENABLED(options))
+            && !PLUGIN_OPTION_LIST(options)
+            && !MAN_CLIENT_AUTH_ENABLED(options))
         {
             const char *use_err = "--%s must be used with --management-client-auth, an --auth-user-pass-verify script, or plugin";
 
#4 lore raw

[Openvpn-devel] [PATCH applied] Re: Fix incorrect condition for checking password related check

Yeah, sorry for not noticing when reviewing db48cea. In retrospective this is quite obviously the correct fix.

Added Github: reference, and URLs to sf.net mail archive & gerrit - the archive at mail-archive.org is broken again :-(

Your patch has been applied to the master branch.

commit 15e663c898fe7a2350c35f5263cbad116cd5b61a

Author: Arne Schwabe
Date:   Sun Mar 23 22:13:53 2025 +0100
     Fix incorrect condition for checking password related check

     Signed-off-by: Arne Schwabe <[email protected]...>
     Acked-by: Antonio Quartulli <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://sourceforge.net/p/openvpn/mailman/message/59164222/
     URL: http://gerrit.openvpn.net/c/openvpn/+/912
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#5 lore raw
In reply to a message not in the archive

cron2 has uploaded a new patch set (#2) to the change originally created by plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/912?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by ordex

Change subject: Fix incorrect condition for checking password related check
......................................................................

Fix incorrect condition for checking password related check

Commit db48cea chagned logic to move logic from a variable and repeated checks to an if clause.

The old code had

            const bool ccnr = (options->auth_user_pass_verify_script
                                || PLUGIN_OPTION_LIST(options)
                                || MAN_CLIENT_AUTH_ENABLED(options));

followed by several condition that checked !ccnr

This commit fixes the if clause by correctly applying De Morgan's law.

Github: closes OpenVPN/openvpn#706

Change-Id I28a8abd0ee3fa9168a716171b0a405476089c4a1

Message-Id: <[email protected]...>
URL: https://sourceforge.net/p/openvpn/mailman/message/59164222/
URL: http://gerrit.openvpn.net/c/openvpn/+/912

---
M src/openvpn/options.c

1 file changed, 2 insertions(+), 2 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/12/912/2

src/openvpn/options.c +2 -2
index 67ef55b..ab56609 100644
@@ -2752,8 +2752,8 @@
 
         }
         if (!options->auth_user_pass_verify_script
-            || PLUGIN_OPTION_LIST(options)
-            || MAN_CLIENT_AUTH_ENABLED(options))
+            && !PLUGIN_OPTION_LIST(options)
+            && !MAN_CLIENT_AUTH_ENABLED(options))
         {
             const char *use_err = "--%s must be used with --management-client-auth, an --auth-user-pass-verify script, or plugin";
 

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/912?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I28a8abd0ee3fa9168a716171b0a405476089c4a1
Gerrit-Change-Number: 912
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: ordex <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: newpatchset

#6 lore raw
In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/912?usp=email )

Change subject: Fix incorrect condition for checking password related check
......................................................................

Fix incorrect condition for checking password related check

Commit db48cea chagned logic to move logic from a variable and repeated checks to an if clause.

The old code had

            const bool ccnr = (options->auth_user_pass_verify_script
                                || PLUGIN_OPTION_LIST(options)
                                || MAN_CLIENT_AUTH_ENABLED(options));

followed by several condition that checked !ccnr

This commit fixes the if clause by correctly applying De Morgan's law.

Github: closes OpenVPN/openvpn#706

Change-Id I28a8abd0ee3fa9168a716171b0a405476089c4a1

Message-Id: <[email protected]...>
URL: https://sourceforge.net/p/openvpn/mailman/message/59164222/
URL: http://gerrit.openvpn.net/c/openvpn/+/912

---
M src/openvpn/options.c

1 file changed, 2 insertions(+), 2 deletions(-)
src/openvpn/options.c +2 -2
index 67ef55b..ab56609 100644
@@ -2752,8 +2752,8 @@
 
         }
         if (!options->auth_user_pass_verify_script
-            || PLUGIN_OPTION_LIST(options)
-            || MAN_CLIENT_AUTH_ENABLED(options))
+            && !PLUGIN_OPTION_LIST(options)
+            && !MAN_CLIENT_AUTH_ENABLED(options))
         {
             const char *use_err = "--%s must be used with --management-client-auth, an --auth-user-pass-verify script, or plugin";
 

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/912?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I28a8abd0ee3fa9168a716171b0a405476089c4a1
Gerrit-Change-Number: 912
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: ordex <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: merged